package com.nightsoul.springboottest2.schedule.task;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ScheduleTask2 {
	private static final Logger LOGGER = LoggerFactory.getLogger(ScheduleTask2.class);
	private static final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
	@Scheduled(fixedRate = 3000)
	private void execute() {
		LOGGER.info("Current Time: " + format.format(new Date()));
	}
	
}
